package com.xky.example_student.config;

import io.swagger.v3.oas.models.OpenAPI;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import io.swagger.v3.oas.models.info.Info;


@Configuration
public class Knife4jConfiguration {

    @Bean
    public OpenAPI openAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("student项目API")
                        .version("1.0")
                        .description("student项目的接口文档"));
    }

    @Bean
    public GroupedOpenApi userAPI() {
        return GroupedOpenApi.builder().group("学生信息管理").
                pathsToMatch("/api/student/**").
                build();
    }

    @Bean
    public GroupedOpenApi systemAPI() {
        return GroupedOpenApi.builder().group("教师信息管理").
                pathsToMatch("/api/teacher/**").
                build();
    }

    @Bean
    public GroupedOpenApi loginAPI(){
        return GroupedOpenApi.builder().group("用户信息管理").
                pathsToMatch("/api/Login/**").
                build();
    }

    @Bean
    public GroupedOpenApi scoreAPI() {
        return GroupedOpenApi.builder().group("分数信息管理").
                pathsToMatch("/api/score/**").
                build();
    }

    @Bean
    public GroupedOpenApi fileAPI() {
        return GroupedOpenApi.builder().group("文件传输管理").
                pathsToMatch("/api/file/**").
                build();
    }
}
